﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using ExcelUtils;

namespace TestEngine.Script.Task
{
    /// <summary>
    /// A task to close and destroy the ExcelSession object.
    /// </summary>
    [Serializable]
    public class CloseSessionTask : ScriptTask
    {       

        protected override bool RunTaskSub(ScriptState state)
        {
            ExcelSession session = state.Session;
            state.Session = null;
            if (session != null)
            {
                session.Dispose();
                session = null;
            }
            return true;
        }
    }
}
